package com.service.Impl;

import com.dao.InfoDao;
import com.mypg.Info;
import com.service.InfoService;
import org.springframework.beans.factory.annotation.Autowired;

import java.sql.Timestamp;
import java.util.List;

public class InfoServiceImpl implements InfoService {

    InfoDao infoDao;

    public InfoServiceImpl(InfoDao infoDao) {
        this.infoDao = infoDao;
    }

    @Override
    public List<Info> selectAllinfo() {
        return infoDao.selectAllinfo();
    }

    @Override
    public Info selectInfoByinfo_id(int info_id) {
        return infoDao.selectInfoByinfo_id(info_id);
    }

    @Override
    public List<Info> selectInfoForinfo_table_jsp(String info_class, Timestamp start, Timestamp end,int start_row,
                                                  int page_nums) {
        return infoDao.selectInfoForinfo_table_jsp(info_class,start,end,start_row,page_nums);
    }

    @Override
    public List<Info> selectInfoByInfo_class(String info_class, String other_class) {
        return infoDao.selectInfoByInfo_class(info_class,other_class);
    }

    @Override
    public int selectInfo_count() {
        return infoDao.selectInfo_count();
    }

    @Override
    public int selectInfo_count_plus(String info_class, Timestamp timestamp_start, Timestamp timestamp_end) {
        return infoDao.selectInfo_count_plus(info_class,timestamp_start,timestamp_end);
    }

    @Override
    public void insertInfo(Info info) {
        infoDao.insertInfo(info);
    }

    @Override
    public void deleteInfoByinfo_id(int info_id) {
        infoDao.deleteInfoByinfo_id(info_id);
    }

    @Override
    public void updateInfoByinfo_id(Info info) {
        infoDao.updateInfoByinfo_id(info);
    }

    @Override
    public void updateInfo_readByInfo_id(int info_id) {
        infoDao.updateInfo_readByInfo_id(info_id);
    }

    public InfoDao getInfoDao() {
        return infoDao;
    }

    public void setInfoDao(InfoDao infoDao) {
        this.infoDao = infoDao;
    }
}
